<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>前后端上线必检清单 | 前端一锅煮</title>
    <meta name="description" content="前后端上线必检清单">
    <link rel="icon" href="/blog/logo.jpg">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="msapplication-TileColor" content="#000000">
    <meta name="keywords" content="前端一锅煮,前后端上线必检清单">
    <link rel="preload" href="/blog/assets/css/0.styles.3a36f1f3.css" as="style"><link rel="preload" href="/blog/assets/js/app.2d50d9dc.js" as="script"><link rel="preload" href="/blog/assets/js/21.ba4dcc65.js" as="script"><link rel="prefetch" href="/blog/assets/js/10.cf06b472.js"><link rel="prefetch" href="/blog/assets/js/11.57a175c6.js"><link rel="prefetch" href="/blog/assets/js/12.b32f2db2.js"><link rel="prefetch" href="/blog/assets/js/13.818a88b3.js"><link rel="prefetch" href="/blog/assets/js/14.1c54dd87.js"><link rel="prefetch" href="/blog/assets/js/15.40ea867f.js"><link rel="prefetch" href="/blog/assets/js/16.379721e3.js"><link rel="prefetch" href="/blog/assets/js/17.0b8bcd15.js"><link rel="prefetch" href="/blog/assets/js/18.41bb3889.js"><link rel="prefetch" href="/blog/assets/js/19.6362af40.js"><link rel="prefetch" href="/blog/assets/js/2.55dfcea5.js"><link rel="prefetch" href="/blog/assets/js/20.4ce40a8a.js"><link rel="prefetch" href="/blog/assets/js/22.d2fad5dd.js"><link rel="prefetch" href="/blog/assets/js/23.2a976f6d.js"><link rel="prefetch" href="/blog/assets/js/24.a6407b77.js"><link rel="prefetch" href="/blog/assets/js/25.28818591.js"><link rel="prefetch" href="/blog/assets/js/26.a4d6759f.js"><link rel="prefetch" href="/blog/assets/js/27.fe72fdf4.js"><link rel="prefetch" href="/blog/assets/js/28.ca4a85a9.js"><link rel="prefetch" href="/blog/assets/js/29.4c6c0c28.js"><link rel="prefetch" href="/blog/assets/js/3.e235257b.js"><link rel="prefetch" href="/blog/assets/js/30.6aa9a972.js"><link rel="prefetch" href="/blog/assets/js/31.b7bccc14.js"><link rel="prefetch" href="/blog/assets/js/32.3544b6a6.js"><link rel="prefetch" href="/blog/assets/js/33.3bb697fd.js"><link rel="prefetch" href="/blog/assets/js/34.ac7cecf3.js"><link rel="prefetch" href="/blog/assets/js/35.b26fe96f.js"><link rel="prefetch" href="/blog/assets/js/36.91eb88f8.js"><link rel="prefetch" href="/blog/assets/js/37.baa3c248.js"><link rel="prefetch" href="/blog/assets/js/4.04108111.js"><link rel="prefetch" href="/blog/assets/js/5.2e3bc3e6.js"><link rel="prefetch" href="/blog/assets/js/6.88208dc4.js"><link rel="prefetch" href="/blog/assets/js/7.7913f494.js"><link rel="prefetch" href="/blog/assets/js/8.64ff3aa5.js"><link rel="prefetch" href="/blog/assets/js/9.43d70a25.js">
    <link rel="stylesheet" href="/blog/assets/css/0.styles.3a36f1f3.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/blog/" class="home-link router-link-active"><!----> <span class="site-name">前端一锅煮</span></a> <div class="links" style="max-width:nullpx;"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/blog/" class="nav-link">首页</a></div><div class="nav-item"><a href="/blog/page/list/" class="nav-link router-link-active">全部文章</a></div><div class="nav-item"><a href="/blog/page/vuepress/" class="nav-link">VuePress笔记</a></div><div class="nav-item"><a href="/blog/page/about/" class="nav-link">关于我</a></div> <a href="https://gitee.com/cjm0/blog" target="_blank" rel="noopener noreferrer" class="repo-link">
    Gitee
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></header> <div class="sidebar-mask"></div> <div class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/blog/" class="nav-link">首页</a></div><div class="nav-item"><a href="/blog/page/list/" class="nav-link router-link-active">全部文章</a></div><div class="nav-item"><a href="/blog/page/vuepress/" class="nav-link">VuePress笔记</a></div><div class="nav-item"><a href="/blog/page/about/" class="nav-link">关于我</a></div> <a href="https://gitee.com/cjm0/blog" target="_blank" rel="noopener noreferrer" class="repo-link">
    Gitee
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav>  <ul class="sidebar-links"><li><div class="sidebar-group first"><p class="sidebar-heading open"><span>前后端上线必检清单</span> <!----></p> <ul class="sidebar-group-items"><li><a href="/blog/page/list/fe_server_check.html#前端上线必检清单" class="sidebar-link">前端上线必检清单</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/blog/page/list/fe_server_check.html#后端上线必检清单" class="sidebar-link">后端上线必检清单</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/blog/page/list/fe_server_check.html#代码相关" class="sidebar-link">代码相关</a></li><li class="sidebar-sub-header"><a href="/blog/page/list/fe_server_check.html#git-相关" class="sidebar-link">git 相关</a></li><li class="sidebar-sub-header"><a href="/blog/page/list/fe_server_check.html#系统相关" class="sidebar-link">系统相关</a></li><li class="sidebar-sub-header"><a href="/blog/page/list/fe_server_check.html#安全相关" class="sidebar-link">安全相关</a></li></ul></li></ul></div></li></ul> </div> <div class="page"> <div class="content"><h1 id="前后端上线必检清单"><a href="#前后端上线必检清单" class="header-anchor">#</a> 前后端上线必检清单</h1> <h2 id="前端上线必检清单"><a href="#前端上线必检清单" class="header-anchor">#</a> 前端上线必检清单</h2> <ol><li><p>回退、跳转是否正确 iOS android 浏览器</p></li> <li><p>节流防抖是否处理</p></li> <li><p>微信分享标题敏感字 红包 钱等</p></li> <li><p>是否适配 320~750 320 480 640 iphonex</p></li> <li><p>是否处理类型转换、非空判断</p></li> <li><p>转换页面加载 loading 处理</p></li> <li><p>无数据、异常、空白页展示处理</p></li> <li><p>移动端扩大点击区域</p></li> <li><p>合理的鼠标光标</p></li> <li><p>是否有做分页</p></li> <li><p>文字超出处理</p></li> <li><p>图片相关</p></li></ol> <ul><li><p>图片是否有做无损压缩</p></li> <li><p>最多使用 2x(两倍CSS像素分辨率)的图片</p></li> <li><p>图片宽高都不超过实际显示宽高的3倍</p></li> <li><p>移动端单张图片大小不超过 50Kb</p></li> <li><p>大的图片统一上 OOS 对象存储，加 CDN 缓存加速</p></li></ul> <ol start="13"><li>网络相关</li></ol> <ul><li><p>首屏时间不超过 3~5 秒</p></li> <li><p>并发 4 个以内（Android 4，iOS 6）</p></li> <li><p>每秒发起的图片请求数不超过 20 个</p></li> <li><p>后端请求必须在 1s 内返回</p></li> <li><p>域名解析数不能超过5个（主域名、API 域名、静态资源 CDN 域名、埋点分析域名）</p></li> <li><p>数据在JSON.stringify后不超过 256KB</p></li> <li><p>页面WXML节点少于 1000 个，节点树深度少于 30 层，子节点数不大于 60 个</p></li> <li><p>所有图片均开启缓存，大图用对象存储加 CDN 缓存</p></li></ul> <ol start="14"><li>权衡</li></ol> <ul><li><p>权衡内置代码带来的 HTTP 请求减少与通过使用外部文件进行缓存带来的好处的折中点</p></li> <li><p>权衡减少 DNS 查找次数和保持较高程度并行下载两者之间的关系</p></li> <li><p>权衡合并 img、CSS、JS 和合并后的文件体积过大问题</p></li></ul> <ol start="15"><li>不出现任何JS异常，所有网络请求都正常返回</li></ol> <h2 id="后端上线必检清单"><a href="#后端上线必检清单" class="header-anchor">#</a> 后端上线必检清单</h2> <h3 id="代码相关"><a href="#代码相关" class="header-anchor">#</a> 代码相关</h3> <ol><li><p>格式是否规范，代码是否有冗余，注释是否完善</p></li> <li><p>文件、变量命名是否规范统一</p></li> <li><p>是否有处理好计时器</p></li> <li><p>是否加错误处理机制 try catch</p></li> <li><p>大表查询是否有做优化，是否处理好缓存</p></li> <li><p>异常是否处理，返回给前端统一格式数据</p></li> <li><p>前端参数传任意字符，后端接口不允许报错中断</p></li></ol> <h3 id="git-相关"><a href="#git-相关" class="header-anchor">#</a> git 相关</h3> <ol><li><p>分支创建是否分层，主干 master，开发分支 dev，个人功能分支 name_dev</p></li> <li><p>上线后分支是否清理干净，上线后删除清理 name_dev 远端和本地分支</p></li> <li><p>代码是否处于私密状态，成员是否加权限限制</p></li> <li><p>commit 提交信息是否准确、规范</p></li></ol> <ul><li><p>feat： 新增feature</p></li> <li><p>fix: 修复bug</p></li> <li><p>perf: 优化相关，比如提升性能、体验</p></li> <li><p>refactor: 代码重构，没有加新功能或者修复bug</p></li> <li><p>docs: 仅仅修改了文档，比如README, CHANGELOG, CONTRIBUTE等等</p></li> <li><p>style: 仅仅修改了空格、格式缩进、都好等等，不改变代码逻辑</p></li> <li><p>test: 测试用例，包括单元测试、集成测试等</p></li> <li><p>chore: 改变构建流程、或者增加依赖库、工具等</p></li> <li><p>revert: 回滚到上一个版本</p></li></ul> <h3 id="系统相关"><a href="#系统相关" class="header-anchor">#</a> 系统相关</h3> <ol><li>服务器资源分配是否合理（内存、核数、储存大小）</li></ol> <ul><li><p>生产环境高配：16核 32g 200g</p></li> <li><p>生产环境常规：8核 16g 150g</p></li> <li><p>数据库机器：8核 16g 500g</p></li> <li><p>redis 机器：8核 64g 150g</p></li> <li><p>测试环境机器：2核 4g 50g</p></li></ul> <ol start="2"><li><p>内存、cpu、硬盘存储是否有异常或者处于紧张状态（空闲率不足 30%）</p></li> <li><p>node npm mongoodb 等版本是否过低，是否和开发环境保持一致，node v12.17.0 npm 6.14.4</p></li> <li><p>nginx 配置是否合理，版本是否过低，nginx 1.16.0+</p></li></ol> <h3 id="安全相关"><a href="#安全相关" class="header-anchor">#</a> 安全相关</h3> <ol><li><p>对于前端输入是否有做校验和过滤，不能信任任何前端输入，后端必须再次校验和过滤</p></li> <li><p>接口是否有防刷机制，验证码、token 凭证、ip 锁定、黑白名单</p></li> <li><p>对于不需要凭证的公开接口是否有做安全防护，是否验证该接口真的不需要凭证可被放开，是的话有没有加防刷机制</p></li> <li><p>秘钥、验证信息、私密信息是否保存在后端环境，不允许直接存在前端</p></li></ol></div> <div class="page-edit"><div class="edit-link"><a href="https://gitee.com/cjm0/blog/edit/master/docs/page/list/fe_server_check.md" target="_blank" rel="noopener noreferrer">在 Gitee 上编辑此页</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <!----></div> <!----> </div> <!----></div></div>
    <script src="/blog/assets/js/app.2d50d9dc.js" defer></script><script src="/blog/assets/js/21.ba4dcc65.js" defer></script>
  </body>
</html>
